﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using coliseu.BussinessLayer; 

namespace coliseu
{
    public partial class FrmListLazer : Form
    {
        private LazerBL lz = new LazerBL(); 
        public FrmListLazer()
        {
            InitializeComponent();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            FrmCadLazer c = new FrmCadLazer(lz);
            c.ShowDialog();
            area_lazerBindingSource.DataSource = lz.selecionar();

        }

        private void FrmListLazer_Load(object sender, EventArgs e)
        {
            area_lazerBindingSource.DataSource = lz.selecionar();

        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            FrmCadLazer c = new FrmCadLazer(((area_lazer)area_lazerBindingSource.Current), lz);
            c.ShowDialog();
            area_lazerBindingSource.DataSource = lz.selecionar();

        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {

            if (MessageBox.Show("Deseja excluir?", "Confirmação", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                lz.excluir((area_lazer)area_lazerBindingSource.Current);
                area_lazerBindingSource.DataSource = lz.selecionar();
            }
        }
    }
}
